package com.woniuxy.springbootrabbit.dead;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DeadConsumer {
    // 接收生产者发送的消息
    @RabbitListener(queues = "dead_queue")  // 监听死信队列
    public void accept(String msg){
        System.out.println("consumer:" + new Date());
        System.out.println("死信消费者接收到:" + msg);
    }
}
